<!doctype html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>git</title>
        <link rel="stylesheet" href="../dist/reset.css">
        <link rel="stylesheet" href="../dist/reveal.css">
        <link rel="stylesheet" href="../dist/theme/white.css" id="theme">
        <link rel="stylesheet" href="../plugin/highlight/monokai.css">
        <style type="text/css">
            .reveal .slide-background-content {
                background-size:100% 100%;
                -moz-background-size:100% 100%;
            }
        </style>
    </head>

    <body>
        <div class="reveal">
            <div class="slides">
                <!-- Use external markdown resource, separate slides by three newlines; vertical slides by two newlines -->
                <section id="section" data-markdown="git.md" data-separator="^<!-- page -->$" data-separator-vertical="^<!-- vert -->$"></section>
            </div>
        </div>
        <script src="../dist/reveal.js"></script>
        <script src="../plugin/markdown/markdown.js"></script>
        <script src="../plugin/highlight/highlight.js"></script>
        <script src="../plugin/notes/notes.js"></script>
        <script>
            let url = window.location.href
            let target = new URLSearchParams(/\?.*/.exec(url)[0]).get("name")
            document.getElementById('section').setAttribute("data-markdown", target)

            Reveal.initialize({
                controls: true,
                progress: true,
                history: true,
                center: true,
                plugins: [ RevealMarkdown, RevealHighlight, RevealNotes ]
            });

            setTimeout((target) => {
                let dir = /(.*\/)\w*.md.*/.exec(target)[1]
                for (let img of document.getElementsByTagName('img')) {
                    let matches = /(.*:\d+\/)(.*)/.exec(img.src)
                    img.src = matches[1] + dir + matches[2]
                }
                for (let div of document.getElementsByClassName('slide-background-content')) {
                    let matches = /(url\("\.\/)(.*)/.exec(div.style.backgroundImage)
                    div.style.backgroundImage = matches[1] + dir + matches[2]
                }
            }, 100, target)
        </script>
    </body>
</html>
